package  routes

import (
	"github.com/iris-contrib/middleware/csrf"
	"github.com/joho/godotenv"
	"github.com/kataras/iris/context"
	"github.com/siaoynli/goProject/web/bootstrap"
	"os"
)
var protect context.Handler
var adminPrefix  string

func  init()  {
	 godotenv.Load()
	 protect = csrf.Protect([]byte(os.Getenv("APP_KEY")), csrf.Secure(false))
	 adminPrefix =os.Getenv("APP_ADMIN_PREFIX")
}

func RouteServiceProvider(app *bootstrap.App) {
	webRouter(app)
	adminRouter(app)
	userRouter(app)
}


